<%@ page contentType="text/html; charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<%@taglib uri="/struts-tags" prefix="s"%>

<c:if test="${empty USER}">
    <jsp:forward page="login.html"/>
</c:if>


<jsp:include page="header.jsp"/>

<c:set var="user" value="${sessionScope.USER.userId}"/>
<a id="totop" class="bgcolor" title="back to top" href="#top-page">
    <img title="" alt="top" src="img/backtop.gif"/> Về đầu trang
</a>
<div id="content">
    <div class="container" style="font-family: Verdana, Geneva, sans-serif;">
        <div class="headline">
            <div class="headline-text float-left width-600">
                <h2>Danh sách toàn bộ các feed hiện tại</h2>
            </div>
            <div class="search-form float-right">
                <form action="feedlist.jsp">
                    <input type="text" name="txtSearch" value="${param.txtSearch}" />
                    <button type="submit">Tìm kiếm</button><br/>
                    <a href="feedlist.jsp?sort=title">Xếp theo tên</a><br/>
                    <a href="feedlist.jsp?sort=addedDate">Xếp theo thời gian</a>
                </form>
            </div>
        </div>

        <c:import url="WEB-INF/dataXML/feed.xml" var="xmldoc" charEncoding="UTF-8"/>
        <c:import url="WEB-INF/xsl/feed.xsl" var="xsldoc" charEncoding="UTF-8"/>

        <c:set var="search" value="${param.txtSearch}"/>
        <c:set var="sort" value="${param.sort}"/>

        <x:transform xml="${xmldoc}" xslt="${xsldoc}">
            <x:param name="userId" value="${user}"/>
            <x:param name="searchName" value="${search}"/>
            <x:param name="sortType" value="${sort}"/>
        </x:transform>
    </div>
</div>

<script type="text/javascript" src="js/jsUtils.js"></script>
<script type="text/javascript">
    activeCurrentNav('listNav');
</script>

<jsp:include page="footer.jsp"/>